﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Kokomo.Lexical.Expressions;

namespace Kokomo.PeInspector.Reflection.Query
{
	class OrderByClause : DependentClause
	{
		public Expression SortExpression { get; private set; }
		public ListSortDirection Direction { get; private set; }

		public OrderByClause(
			QueryClause source,
			Expression sortExpression,
			ListSortDirection direction = ListSortDirection.Ascending
			)
			: base(source)
		{
			if (sortExpression == null) throw new ArgumentNullException("sortExpression");

			this.SortExpression = sortExpression;
			this.Direction = direction;
		}
	}
}
